﻿using System.Text;
using System.Web;
using WebDotNet.Extensions;

namespace WebDotNet.Samples.HelloWorld.Handlers
{
	public class Redirect
	{
		public StringBuilder Get(HttpContextBase httpContextBase, string redirectType)
		{
			if (redirectType == "seeother")
			{
				httpContextBase.SeeOther("/");
			}
			else if (redirectType == "redirect")
			{
				httpContextBase.Redirect("/");
			}
			else
			{
				httpContextBase.NotFound();
				return new StringBuilder("Page not found.");
			}

			return null;
		}
	}
}